const fs = require("fs");

function readWeiXue() {
  return new Promise((resolve, reject) => {
    fs.readFile("./resources/为学.md", (err, data) => {
      if(err) reject(err);
      resolve(data);
    })
  })
}
function readChaYang() {
  return new Promise((resolve, reject) => {
    fs.readFile("./resources/插秧诗.md", (err, data) => {
      if(err) reject(err);
      resolve(data);
    })
  })
}
function readGuanShu() {
  return new Promise((resolve, reject) => {
    fs.readFile("./resources/观书有感.md", (err, data) => {
      if(err) reject(err);
      resolve(data);
    })
  })
}

async function main() {
  let weixue = await readWeiXue();
  let chayang = await readChaYang();
  let guanshu = await readGuanShu();

  console.log(weixue.toString());
  console.log(chayang.toString());
  console.log(guanshu.toString());
}
main();
